﻿<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>修改密码</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../style/adminStyle.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-3.1.1.min.js"></script>
<script type="text/javascript">
function updatepwd() {
	
	//验证两次输入密码是否相同
	
		var oldPwd = $("#password1").val();
		var newPwd = $("#password2").val();
		if(oldPwd==newPwd){
			$.ajax({
				"url":"../Administrators/updatePassword.do",
				"data":"newPassword="+newPwd,
				"type":"POST",
				"dataType":"json",
				"success":function(obj){

					if(obj.state==1){
						alert("密码修改成功");
						window.location="${pageContext.request.contextPath}/Administrators/admin_list.do"
					}else{
						alert("密码修改失败");
					}
				}
			});
				
		}else{
			 alert("新密码不一致");
			 return false;
		}

	
	
	
	
}

</script>
</head>

<body>
 <div class="wrap">
  <div class="page-title">
    <span class="modular fl"><i class="user"></i><em>修改密码</em></span>
  </div>
  <table class="noborder">
   
  
   <tr>
    <td style="text-align:right;">新密码：</td>
    <td><input type="password" class="textBox length-middle" name="password1" id="password1" autocomplete="new-password"/></td>
   </tr>
   <tr>
    <td style="text-align:right;">再次确认密码：</td>
    <td><input type="password" class="textBox length-middle" name="password2" id="password2" autocomplete="new-password"/></td>
   </tr>
   <tr>
    <td style="text-align:right;"></td>
    <td><input type="submit" class="tdBtn" value="保存" onclick="updatepwd()"/></td>
   </tr>
 
  </table>
 </div>
</body>

</html>